import { BufferGeometry3D } from 'feng3d-three';
import { TextGeometry, TextGeometryParameters } from '../thirdparty/three/imports';

export class TextGeometry3D extends BufferGeometry3D
{
    text: string;
    parameters: TextGeometryParameters;

    get _geometry()
    {
        if (!this.__geometry)
        {
            this.__geometry = new TextGeometry(this.text, this.parameters);
        }

        return this.__geometry;
    }
    declare protected __geometry: TextGeometry;

    constructor()
    {
        super();
    }

    destroy()
    {
        this.__geometry = null;
    }
}
